package com.zry.pda.ui.activity

import com.zry.pda.R
import com.zry.pda.databinding.ActivityOperationRecordInfoBinding
import com.zry.pda.presenter.OperationRecordInfoPresenter
import com.zry.pda.ui.base.BaseActivity
import kotlinx.android.synthetic.main.common_title.*

class OperationRecordInfoActivity : BaseActivity() {
    private var operationRecordInfoBinding: ActivityOperationRecordInfoBinding? = null
    private var operationRecordInfoPresenter: OperationRecordInfoPresenter? = null
    var flowCodeID: String = ""
    var title = ""
    var detailID = ""
    var recordID = ""
    override fun getLayoutId(): Int {
        return R.layout.activity_operation_record_info
    }

    override fun initData() {
        title = intent.getStringExtra("title")
        when (title) {
            "批量装箱", "号段装箱", "打包记录" -> {
                flowCodeID = intent.getStringExtra("FlowCodeID")
            }
            "入库记录" -> {
                detailID = intent.getStringExtra("DetailID")
            }
            "出库记录" -> {
                detailID = intent.getStringExtra("DetailID")
            }
            "补码记录", "拆码记录" -> {
                recordID = intent.getStringExtra("RecordID")
            }
        }

        titleCenterText.text = getString(R.string.operationRecordInfo)
        commonLeftLinearLayout.setOnClickListener { finish() }
        operationRecordInfoBinding = viewDataBinding as ActivityOperationRecordInfoBinding
        operationRecordInfoPresenter = OperationRecordInfoPresenter(this)

        operationRecordInfoPresenter?.initRecycler()
        operationRecordInfoPresenter?.getFlowCodeDetailList()
    }
}
